home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 12 / 64er_Magazin_Sonderheft_12_86-12_1986_Markt__Technik_de_Side_A.d64 / move-demo 2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  417b  |  25 lines

  1. 100 rem *****************
  2. 110 rem *** move-demo ***
  3. 120 rem *sortierte liste*
  4. 130 rem *****************
  5. 140 :
  6. 150 am=100
  7. 155 dim a$(am)
  8. 160 print chr$(147)
  9. 167 ad=ad+1
  10. 170 input"datensatz";da$
  11. 180 s=0:e=ad:gosub 510:rem bi-suche
  12. 190 sys 49152,a$(e),a$(e+1),(am-e)*3
  13. 200 a$(e)=da$
  14. 215 print:print
  15. 217 for i=1 to ad:print a$(i):next
  16. 220 goto 167
  17. 230 :
  18. 240 :
  19. 500 rem *** binaere suche ***
  20. 510 m=int((s+e)/2)
  21. 520 if da$>a$(m) then s=m:goto 540
  22. 530 e=m
  23. 540 if e-s>1 then gosub 510
  24. 550 return
  25.